package com.allm.ai.common.strategy.impl;

import com.allm.ai.common.entity.AiModel;
import com.allm.ai.common.dto.ApiRequest;
import com.allm.ai.common.strategy.AiModelStrategy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class GenericAIStrategy implements AiModelStrategy {
    
    @Override
    public String callApi(AiModel model, ApiRequest request) throws Exception {
        log.info("调用通用 AI API，模型: {}, 端点: {}", model.getName(), model.getApiEndpoint());
        
        // 实现通用 AI API 调用逻辑
        return "Generic AI response for: " + request.getMessages();
    }
    
    @Override
    public boolean supports(String serviceProvider) {
        // 作为默认策略，支持所有未被其他策略支持的提供商
        return true;
    }
    
    /**
     * 通用策略暂不支持流式调用
     */
    @Override
    public boolean supportsStreaming() {
        return false;
    }
} 